<div id="menuposition">&nbsp;</div>
<script language="JavaScript" src="<%#VirtualDirectory%>/JavaScripts/fw_menu.js"></script>
<script language="JavaScript" src="<%#VirtualDirectory%>/JavaScripts/treeview/ftiens4.js"></script>
<script language="JavaScript" src="<%#VirtualDirectory%>/JavaScripts/treeview/ua.js"></script>

<script>
function displayMenu(menu,postag,xOffset)	{
//x=menu.offsetLeft + 10;
//y=menu.offsetHeight+30;
x=getOffsetLeft(postag);
y=getOffsetTop(postag);

FW_showMenu(menu,xOffset+x,y+20,null,'image1')

}

function ManipulateActionClick(actionName)
{
	document.getElementsByTagName("input")["actionClick"].value = actionName;
	//alert(document.getElementsByTagName("input")["hidOpenNode"].value)

	document.forms[0].submit();
}
var ICONPATH = '<%#VirtualDirectory%>/images/treeview/';
</script>
<style>
   /* styles for the tree */
   SPAN.TreeviewSpanArea A {
        font-size: 10pt;
        font-family: verdana,helvetica;
        text-decoration: none;
        color: black
   }
   SPAN.TreeviewSpanArea A:hover {
        color: '#820082';
   }
   /* rest of the document */
   BODY {background-color: white}
   TD {
        font-size: 10pt;
        font-family: verdana,helvetica;
   }
</style>

<TABLE width='100%' class='toolbartable' ID="Table1" border=0>
	<TR>
		<TD align=left id="menubar">

			<!--<INPUT TYPE=button value=Open class=toolbarbutton  onclick=wf_openpropertypage('open','','','height=180,width=325,resizable=yes') ID="Button1" NAME="Button1">
			<INPUT TYPE=button value=Rename class=toolbarbutton   onclick=wf_openpropertypage('rename','','','height=180,width=325,resizable=yes') ID="Button2" NAME="Button2">
			<INPUT TYPE=button value="Save As" class=toolbarbutton onclick=wf_openpropertypage('saveas','','','height=180,width=325,resizable=yes') ID="Button3" NAME="Button3">
			<INPUT TYPE=button value=Delete class=toolbarbutton  onclick=wf_openpropertypage('delete','','','height=180,width=325,resizable=yes') ID="Button4" NAME="Button4">
			<INPUT TYPE=button value="Export" class=toolbarbutton onclick="javascript:location.href='?export=true'" ID="Button7" NAME="Button7">
			<INPUT TYPE=button value="Import" class=toolbarbutton onclick=wf_openpropertypage('import','','','height=180,width=325,resizable=yes') ID="Button8" NAME="Button8">
			<INPUT TYPE=button value="Open Deployed" style="width:100" class=toolbarbutton  onclick=wf_openpropertypage('opendeployed','','','height=200,width=375,resizable=yes') ID="Button5" NAME="Button5">
			<INPUT TYPE=button value=Deploy class=toolbarbutton  onclick=wf_openpropertypage('deploy','','','height=200,width=325,resizable=yes') ID="Button6" NAME="Button6">-->
			<script language="JavaScript1.2">mmLoadMenus();</script>
			<img src="<%#VirtualDirectory%>/Images/menu.gif" name="image1" width="289" height="23" border="0" usemap="#Map" id="image1">

			 <map name="Map">
			   <area shape="rect" coords="-2,-1,91,35" href="#" onMouseOver="displayMenu(window.mm_menu_0727171053_0,document.getElementById('image1'),2)" onMouseOut="FW_startTimeout();">
			   <area shape="rect" coords="96,3,188,51" href="#" onMouseOver="displayMenu(window.mm_menu_0728101127_0,document.getElementById('image1'),98)" onMouseOut="FW_startTimeout();">
			   <area shape="rect" coords="194,0,373,45" href="#" onMouseOver="displayMenu(window.mm_menu_0728101229_0,document.getElementById('image1'),194)" onMouseOut="FW_startTimeout();">
			 </map>
			<INPUT TYPE=hidden name=filename value="<%#workflowfilename%>" ID="Hidden1">
			<INPUT TYPE=hidden name=actionClick value='' ID="Hidden1">
		</TD>
		<TD align=left>
			<Table class='toolbartable' ID="Table2">
				<tr>
					<td><span class='toolbartext'>Zoom:</span></td><td>
						<SELECT NAME=imagesize class=toolbarselect ONCHANGE="wf_resizeimage(this.value)" ID="Select1">
							<%#imagesizeoptions%>
						</SELECT>
					</td>
				</tr>
			</table>
		</TD>
		<td align=right width=100%>
			<TABLE class='toolbartable' ID="Table3">
				<tr>
					<TD>
						<span class='toolbartitleheading'>Workflow:</span> <span class='toolbartitle'><%#workflowname%></span>
					</TD>
					<TD>
						&nbsp;
						<span class='toolbartitleheading'>File:</span> <span class='toolbartitle'><%#workflowfilename%></span>
					</TD>
				</tr>
			</TABLE>
		</TD>
	</TR>
</TABLE>

<script>
	 	function getOffsetLeft(el)
		{
		  var ol=el.offsetLeft;
		  while((el=el.offsetParent)!=null)
		  ol+=el.offsetLeft;
		  return ol;
		 }

			//--Function aligning the control towards top.
		 function getOffsetTop(el)
		  {
			var ot=el.offsetTop;
			while((el=el.offsetParent)!=null)
			ot+=el.offsetTop;
			return ot;
		 }

			//--Function finding the present position of the control.
			 function findCoordinates(table)
			{
					var tableLeft=getOffsetLeft(table);
					var tableTop=getOffsetTop(table);
					var docHeight=window.screen.height;
					var tableDiff=docHeight-tableTop;
					if(tableDiff > 300){
						return 1;
					}else{
						return 0;
					}
			 }

			 function <%#UniqueID%>ResizePropertyBox()
			 {

				 if(typeof(<%#divname%>) != "undefined" &&  <%#divname%>.scrollHeight > <%#divname%>.clientHeight )
				 {
					if( <%#divname%>.scrollHeight >= (<%#iframename%>.frameElement.offsetHeight-55))
						{
							if((<%#iframename%>.frameElement.offsetHeight-55) <= 0)
								 <%#divname%>.style.height=<%#iframename%>.frameElement.offsetHeight;
							else
	 	 					 	<%#divname%>.style.height=<%#iframename%>.frameElement.offsetHeight-55;
						}
					else
						{
							//<%#divname%>.style.height=<%#divname%>.scrollHeight;
							<%#divname%>.style.height='100%'
						}
				 }
				 else
				 {
				 	if(typeof(<%#divname%>) != "undefined")
					 	<%#divname%>.style.height='100%'
				 }


				if(typeof(PropertyDivToobbox1) != "undefined" && PropertyDivToobbox1.scrollHeight > PropertyDivToobbox1.clientHeight )
				 {
					if( PropertyDivToobbox1.scrollHeight >= (<%#iframename%>.frameElement.offsetHeight-55))
					{

						if((<%#iframename%>.frameElement.offsetHeight-55) <= 0)
							 PropertyDivToobbox1.style.height=<%#iframename%>.frameElement.offsetHeight;
						else
							PropertyDivToobbox1.style.height=<%#iframename%>.frameElement.offsetHeight-55;

					}
					else
					{
						var diff = document.body.scrollHeight - document.body.offsetHeight
						if((<%#iframename%>.frameElement.offsetHeight) > document.body.offsetHeight)
						{
							reduceHeight = (PropertyDivToobbox1.offsetHeight- (diff+20));

							if(reduceHeight > 0)
							{
								PropertyDivToobbox1.style.height=reduceHeight
								if(<%#divname%>.scrollHeight > document.body.offsetHeight)
								{
									<%#divname%>.style.height=reduceHeight
								}
							}
							else
								PropertyDivToobbox1.style.height='100%';
						}
						else
							PropertyDivToobbox1.style.height='100%';
					}
				 }
				 else
				 {

					var diff = document.body.scrollHeight - document.body.offsetHeight
					if((<%#iframename%>.frameElement.offsetHeight) > document.body.offsetHeight)
					{
						reduceHeight = (PropertyDivToobbox1.offsetHeight- (diff+20));

						if(reduceHeight > 0)
						{
							PropertyDivToobbox1.style.height=reduceHeight
							if(<%#divname%>.scrollHeight > document.body.offsetHeight)
							{
								<%#divname%>.style.height=reduceHeight
							}
						}
						else
							PropertyDivToobbox1.style.height='100%';
					}
					else
						PropertyDivToobbox1.style.height='100%';
				 }
			 }

	 var iframeHeight=0;
	 function setIframeHeight()
	 {
		iframeHeight =<%#iframename%>.frameElement.offsetHeight;
	 }
	 var executeresizeHandle=1;
	 function resizeHandle()
	 {

		if(executeresizeHandle)
		{
		//This code should be executed only when clicked on the link and not on onload
		//This condition was given coz the autoscroll to a specific action was nto happening at some conditions
			if(PropertyDivToobbox1.scrollHeight >= (iframeHeight-55))
				{

					if((iframeHeight-55) <= 0)
						 PropertyDivToobbox1.style.height=iframeHeight;
					else
						PropertyDivToobbox1.style.height=iframeHeight-55;

				}
				else
					PropertyDivToobbox1.style.height='100%';

		}
		executeresizeHandle=1;
	 }

	 function CallClickOnNode(node)
	 {
	 	executeresizeHandle=0;
	 	clickOnNode(node);

	 }

</script>
